home *** CD-ROM | disk | FTP | other *** search
/ CD ROM Paradise Collection 4 / CD ROM Paradise Collection 4 1995 Nov.iso / program / swagd_f.zip / DATETIME.SWG / 0013_LEAPYEAR.PAS.pas < prev    next >
Pascal/Delphi Source File  |  1993-05-28  |  474b  |  14 lines

  1. {
  2. > I'm doing some date routines and I need to know if it is a leap year to
  3. > validate a date..   A leap year is evenly divisble by 4..  I have no
  4. > idea how to check to see if a remainder is present..  I'm going to try
  5. > to read my manauls and stuff... but I'd appreciate any help!  Thanks!
  6. }
  7.  
  8.   LeapYear := Byte((Year mod 4 = 0) and (Month = 2));
  9.  
  10.   if LeapYear = 1 then
  11.     if Byte((Year mod 100 = 0) and (Year mod 400 <> 0)) = 1 then
  12.       LeapYear := 0;
  13.  
  14.